import org.sparkle.html.impl.basic.Div;
import org.sparkle.html.impl.basic.Head;
import org.sparkle.html.impl.basic.Head.DefaultScript;
import org.sparkle.html.impl.basic.Head.DefaultStyle;
import org.sparkle.html.impl.basic.Html;
import org.sparkle.html.impl.basic.Head.Meta;
import org.sparkle.html.impl.basic.Script;
import org.sparkle.html.impl.basic.Style;
import org.sparkle.web.page.AbstractPage

class Init extends AbstractPage {

	@Override
	public Object render() {
		/*
		def writer = new StringWriter()
		def builder = new groovy.xml.MarkupBuilder(writer)
		
		builder.html {     
		  head {         
		    title"Company Template"
			meta(http-equiv:"content-type")
			
		  }     
		  body {
		    h1"XML encoding with Groovy"   
		    p"this format can be used as an alternative markup to XML"      
		
		    a(href:'http://groovy.codehaus.org', "Groovy")
		
		    p {     
		      mkp.yield "This is some"
		      b"mixed"   
		      mkp.yield " text. For more see the"
		      a(href:'http://groovy.codehaus.org', "Groovy")
		      mkp.yield "project"    
		    }      
		    p "some text"    
		  } 
		}
		
		return writer.toString();
		*/
		
		
		//Head head=new Head();
		//html.getBody()
		
		String context="/sparkle";
		
		Meta m=new Meta();
		m.addAttr("name", "viewport");
		m.addAttr("content", "width=device-width, initial-scale=1.0");
		
		getHtml().getHead().append(m);// DefaultScript("/static/js/jquery-1.9.1.js"));
		
		getHtml().getHead().addStyleFile(context+"/template/static/css/bootstrap.css");
		getHtml().getHead().addStyleFile(context+"/template/static/css/bootstrap-responsive.css");
		
		DefaultStyle less=new DefaultStyle();
		less.addAttr("rel","stylesheet/less");
		less.addAttr("href",context+"/template/static/css/style.less");
		
		getHtml().getHead().append(less);
		
		
		Div pageContainer=new Div();
		pageContainer.setId("page-container");
		pageContainer.setClassStyle("container-fluid");
		
		Div loading=new Div();
		loading.setId("loading");
		
		pageContainer.append(loading);
		
		getHtml().getBody().append(pageContainer);
		
		getHtml().getBody().append(new DefaultScript(context+"/template/static/js/jquery-1.10.1.js"));
		getHtml().getBody().append(new DefaultScript(context+"/template/static/js/jquery-migrate-1.2.1.js"));
		getHtml().getBody().append(new DefaultScript(context+"/template/static/js/less-1.3.3.min.js"));
		getHtml().getBody().append(new DefaultScript(context+"/template/static/js/bootstrap.js"));
		getHtml().getBody().append(new DefaultScript(context+"/template/static/js/internal.js"));
		
	/*
		
		<link rel="stylesheet" type="text/css" href="/sparkle/static/css/bootstrap.css">
		<link rel="stylesheet" type="text/css" href="/sparkle/static/css/bootstrap-responsive.css">
		<link rel="stylesheet/less" type="text/css" href="/sparkle/static/css/style.less">
		
		<body>
		<div id="page-container" class="container-fluid">
		</div>
		 <div id="loading">Caricamento in corso...</div>
	</body>
	
	<script type="text/javascript" src="/sparkle/static/js/jquery-1.9.1.js"></script>
	<script type="text/javascript" src="/sparkle/static/js/jquery-migrate-1.1.1.js"></script>
	<script type="text/javascript" src="/sparkle/static/js/less-1.3.1.min.js"></script>
	<script type="text/javascript" src="/sparkle/static/js/bootstrap.js"></script>
	<script type="text/javascript" src="/sparkle/static/js/internal.js"></script>
		*/
		
		
		
		
		return getHtml();
		
	}

}